home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
MSDOS
/
(m)aac
/
NYWHELP.16
< prev
next >
Wrap
Text File
|
1986-08-02
|
2KB
|
46 lines
SEARCH AND SUBSTITUTION COMMANDS
<+SEARCH> searches from the cursor position forwards for the specified
pattern.
<-SEARCH> searches backwards from the cursor position for the
specified pattern.
For the two commands above, you are allowed to put any regular
expression as a pattern. You are then asked if you would like to
ignore the case of the letters when searching. Regular expressions
consist of the following metacharacters :
^ matches the beginning of a line
$ matches the end of a line
? matches any character
* matches 0 or more occurences of the previous pattern
[] character class
When you invoke these commands, you will be given the previous pattern
you typed in as a default. If you press <RETURN>, that pattern will be
used again. (If the previous pattern shown to you ends with a '!', it
means that you wanted to ignore the case.)
<+SUBST> searches from the cursor position forwards for the specified
pattern, and for each occurence of the pattern, substitutes the
replacement string.
<-SUBST> searches backwards from the cursor position, then substitutes
the replacement string.
The replacement string can have the metacharacter '&', which means
to substitute the matched pattern as part of the replacement. For
instance, if your pattern to search for was 'cat', and the replacement
string is 'alley&', then the word 'alleycat' will be replaced for each
occurence of 'cat'.
You are asked if you want to approve each substitution. If you
reply 'n', then the replacements will be made globally from the cursor
position to the end (or beginning) of the file. If you reply 'y', then
when the pattern is found you are asked if you want to replace it,
ignore it, or stop the substitution operation totally.
<GLOBALSUB> allows you to perform multiple substituions at once.
When you use this command, the screen clears, and you are given a new
buffer in which to enter your substitution patterns. Each line that
you type must be of the form :
pattern=replacement
where the pattern can be any regular expression. After you have
finished typing all of the substitution patterns, press <CTRL D> and
the substitution operation will begin.